package com.neuedu.spring.service;

import com.neuedu.spring.dao.IUserDao;
import com.neuedu.spring.dao.UserDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class UserService {

    /**
     * Autowired 默认 byName  如果出现多个指定名字的 需要使用Qualifier 区分不同的名字
     */
    @Autowired
    @Qualifier(value="userDaoOther")
    IUserDao userDao ;  //byType     userDao   userDaoOther

    public void sayService(){
        System.out.println("UserService.sayService");
        userDao.sayDao();
    }
}
